#include "fake.h"
#include "Lock.h"
#include <signal.h>

const uint32_t UM_SIZE = 1024 * 1024;
const int NUM_OF_TESTS = 1e7;
const int OUTPUT_FREQUENCY = NUM_OF_TESTS / 10;

volatile uint32_t has_call = false;
volatile uint32_t has_ret = false;


void thread_notify_normal(int)
{
    atomic_write_uint32(&has_ret, 1);
}
void thread_notify_enclave(int)
{
    atomic_write_uint32(&has_call, 1);
}

void fake_enclave_signal_handler(int sig)
{
    if (sig == SIGUSR1)
    {
        atomic_write_uint32(&has_call, 1);
    }
}

void fake_normal_signal_handler(int sig)
{
    if (sig == SIGUSR1)
    {
        atomic_write_uint32(&has_ret, 1);
    }
}

